<?php

/*

Find the Needle (find_the_needle.php)

*/

$rank_check = 1;
$page_title = "Find the Needle";
include "header.inc.php";

$findFingerPrizes = fetch("SELECT * FROM find_needle WHERE game = '$game'");
if (!$findFingerPrizes[prize])
{
	$findFingerPrizes[prize] = "500";
}
if (!$findFingerPrizes[x1_location]) { $findFingerPrizes[x1_location] = "20"; }
if (!$findFingerPrizes[y1_location]) { $findFingerPrizes[y1_location] = "20"; }

if (!$findFingerPrizes[x2_location]) { $findFingerPrizes[x2_location] = "80"; }
if (!$findFingerPrizes[y2_location]) { $findFingerPrizes[y2_location] = "80"; }

if (!$findFingerPrizes[x3_location]) { $findFingerPrizes[x3_location] = "100"; }
if (!$findFingerPrizes[y3_location]) { $findFingerPrizes[y3_location] = "100"; }

print $openHTML;

if ($act == "play")
{
	points("$game", "$username", "-10");
	if (($x == "$findFingerPrizes[x_location]") AND ($y == "$findFingerPrizes[y_location]"))
	{
		points("$game", $username, "5000");
	}
	print "x - $x and y - $y";
}

if (!$act)
{

ECHO <<<END

<p>Welcome to "Find the Needle" the object of this game is to try to find the needle in that hay stack over there. If you can find it there is a great prize involved :) It costs 10 $pointVar per play!</p>

<p align=center>
<form action=find_the_needle.php?act=play method=post>
<INPUT TYPE=image SRC="images/games/finger.jpg" WIDTH=250 HEIGHT=238 ALIGN=bottom>
<form>
</p>

END;

}

?>